<template>
  <template v-if="props.column.dataIndex === 'actions'">
    <a-button type="link" :size="'small'" @click="emits('actions-edit', props.record)"
      >编辑</a-button
    >
    <a-button type="link" :size="'small'" @click="emits('actions-dict', props.record)"
      >字典值</a-button
    >
    <a-button danger type="link" :size="'small'" @click="emits('actions-delete', props.record)"
      >删除</a-button
    >
  </template>
  <template v-else>
    {{props.text}}
  </template>
</template>

<script setup lang="ts">
import { defineEmits, defineProps } from 'vue'
export interface TableActionsProps {
  column: Record<string, string>
  record: Record<string, string>
  index: number
  text: string
}
const props = defineProps<TableActionsProps>()
const emits = defineEmits(['actions-edit', 'actions-delete', 'actions-dict'])
defineOptions({
  name: 'ActionsBtn',
})
</script>
